import AppStore from "../store/appStore";
import axiosUtil from "../utils/axiosUtil";
import viewUtil from '../utils/viewUtil';
import {CreateHaoDanwangList} from "./modeCtr";

export function getDouYin(nextPage) {
  return new Promise(resolve =>{
    var url = AppStore.data.taoBaoApi.trill_data.format(AppStore.data.taoBaoApi.haoDanKey,nextPage)
    // console.log(url)
    axiosUtil.get( url).then(res=>{
      console.log(res)
      if (parseInt(res.code) !== 1){
        viewUtil.ShowToast('亲,数据到底了！～～');
        resolve(null)
      }else{
        resolve({data: res.data, pageIndex: res.min_id});
      }
    })
  } )
}
